package com.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

public class OpDB {
    private DB mydb = new DB();

    public OpDB() {
    }

    public int OpUpdate(String sql, Object[] params) {
        int i = -1;
        this.mydb.doPstm(sql, params);

        try {
            i = this.mydb.getCount();
        } catch (SQLException var8) {
            System.out.println("执行OpUpdate()方法失败！(更新数据库)");
            var8.printStackTrace();
        } finally {
            this.mydb.closed();
        }

        return i;
    }

    public boolean LogOn(String sql, Object[] params) {
        this.mydb.doPstm(sql, params);

        try {
            ResultSet rs = this.mydb.getRs();
            boolean mark = rs != null && rs.next();
            rs.close();
            boolean var6 = mark;
            return var6;
        } catch (SQLException var9) {
            System.out.println("登录失败！");
            var9.printStackTrace();
        } finally {
            this.mydb.closed();
        }

        return false;
    }
}
